using System;
using Newtonsoft.Json;

namespace FBGraph.Models
{
    /// <summary>Describes an RSVP response to an <see cref="Event" /></summary>
    public partial class EventRsvp : IFBGraphResult
    {
        /// <summary>The name of the <see cref="User" /> or <see cref="Page" /> responding to the <see cref="Event" /></summary>
        [JsonPropertyAttribute("name")]
        public String Name { get; set; }
        
        /// <summary>The Graph API id of the <see cref="User" /> or <see cref="Page" /> responding to the <see cref="Event" /></summary>
        [JsonPropertyAttribute("id")]
        public Int64 Id { get; set; }
        
        /// <summary>Gets or sets a <see cref="Boolean" /> value representing whether the object has been populated.</summary>
        Boolean IFBGraphResult.IsReady { get; set; }
        /// <summary>Updates the current model with values from another like-typed model.</summary>
        /// <param name="other">The source model.</param>
        /// <remarks>This is used for asynchronous calls to update the reference that was returned when the original API method was called.</remarks>
        void IFBGraphResult.UpdateFrom(IFBGraphResult other)
        {
            var that = other as EventRsvp;
            if (that == null) return;
            else
            {
                this.Name = that.Name;
                this.Id = that.Id;
                ((IFBGraphResult)this).IsReady = true;
            }
            
        }
    }
}